<div ng-init="vm.init();refresh(vm.callback);">
  <script id="opt-toolbar" type="text/ng-template">
    <div ng-if="sessionUser.role">
      <button class="btn btn-default" type="button" ng-click="vm.edit()"
          ng-if="sessionUser.role == 'admin'"><i class="fa fa-plus"></i> 添加模块</button>
      <a class="btn btn-default" href="#!/mock-history" target="_blank" ng-if="vm.modules.length > 0">
        <i class="fa fa-history"></i> 版本历史
      </a>
    </div>
  </script>
  <div class="row x-view-body">
    <div class="col-md-12">
      <div class="row x-module-list">
        <div class="col-md-4 col-lg-3" ng-repeat="module in vm.modules">
          <div class="thumbnail">
            <div class="caption">
              <h1 ng-class="{'x-readonly': !sessionUser.role}">
                <a ng-href="{{'#!/mock-editor/' + module.name}}">{{module.name}}</a>
              </h1>
              <p class="text-right" ng-if="sessionUser.role">
                <button class="btn btn-default" ng-click="vm.proxy(module.name)" title="代理配置"
                    ng-disabled="!module.proxy"><i class="fa fa-server"></i></button>
                <button class="btn btn-default" ng-click="vm.edit(module.name)"
                    ng-if="sessionUser.role == 'admin'" title="编辑"><i class="fa fa-pencil"></i></button>
                <button class="btn btn-default" ng-click="vm.remove(module.name)"
                    ng-if="sessionUser.role == 'admin'" title="删除"><i class="fa fa-trash-o"></i></button>
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
